home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
cpp_libs
/
answrbok
/
5_9.lha
/
5_9
/
tstrand.c
< prev
Wrap
Text File
|
1993-08-08
|
337b
|
20 lines
* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */
* The C++ Answer Book */
* Tony Hansen */
* All rights reserved. */
ifdef __cplusplus
xtern "C" {
endif
xtern int rand();
xtern void srand(unsigned int);
ifdef __cplusplus
endif
nt randint(int u)
int r = rand();
if (r < 0) r = -r;
return 1 + r % u;